package com.sunday.common.mq.rocket.brave.study.apache.e1_Normal_Message;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

/**
 * https://github.com/apache/rocketmq-spring/wiki/Consume-Message
 */
@Deprecated
@Slf4j
//@Service
@RocketMQMessageListener(topic = "your_topic", consumerGroup = "your_consumer_group_name", consumeThreadNumber = 1)
public class MessageExtConsumer implements RocketMQListener<MessageExt> {

    @Override
    public void onMessage(MessageExt message) {
        log.info("{} - {}", new String(message.getBody()), message);
    }

}
